<#include "include.ftl">
<#macro minMaxReading name var format="%2.1f%s">
        <td class="reading">
        <h2>${name}</h2>
        <#if var.current?has_content>
        <h1 align="center">${var.current.format(format)} </h1>
        <p> <#if var.min.unitValue.value?has_content > Min: ${var.min.format(format + " @ %tc")}</#if></p>
        <p> <#if var.max.unitValue.value?has_content > Max: ${var.max.format(format + " @ %tc")}</#if></p>
        </#if>
        
        </td>
</#macro>

<html>
<head>
<title>JWeather - ${stationName} /></title>
<link rel="stylesheet" href="<@spring.theme code="styleSheet"/>" type="text/css" />
</head>
<body>
<h1>${stationName} ${readings.readingTime?time}</h1>

<table>
    <tr>
	  <@minMaxReading name="Indoor Temperature" var=readings.indoorTemperature/>
	  <@minMaxReading name="Indoor Humidity" var=readings.indoorHumidity/>
	  <@minMaxReading name="Outdoor Temperature" var=readings.outdoorTemperature/>
	  <@minMaxReading name="Outdoor Humidity" var=readings.outdoorHumidity/>	  
    </tr>
    <tr>
	  <@minMaxReading name="Air Pressure" var=readings.airPressure/>
	  <@minMaxReading name="Wind Speed" var=readings.windSpeed format="%2.1f%s %s"/>
	  <@minMaxReading name="Rain 1hr" var=readings.rain1H/>
	  <@minMaxReading name="Rain 24hr" var=readings.rain24H/>	  
    </tr>
</table>
</body>
</html>
        